<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./dist/ClassInherit.js"></script>

    <script>
      Function.prototype.construct = function (aArgs) {
        var oNew = Object.create(this.prototype);
        this.apply(oNew, aArgs);
        return oNew;
      };

      function MyConstructor() {
        // for (var nProp = 0; nProp < arguments.length; nProp++) {
        //   this["property" + nProp] = arguments[nProp];
        // }
        console.log(arguments.length, arguments)
      }


      var myArray = [4, "Hello world!", false];
      var myInstance = MyConstructor.construct(myArray); //Fix MyConstructor.construct is not a function

      console.log(myInstance.property1); // logs "Hello world!"
      console.log(myInstance instanceof MyConstructor); // logs "true"
      console.log(myInstance.constructor); // logs "MyConstructor"
    </script>
  </body>
</html>
